<!DOCTYPE html>
<html>
<head>
	<meta http-equiv="X-UA-Compatible" content="IE=Edge">
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<title>商家管理后台</title>
	<link type="image/x-icon" href="<?php echo IUrl::creatUrl("")."favicon.ico";?>" rel="icon">
	<script type="text/javascript" charset="UTF-8" src="/runtime/_systemjs/jquery/jquery-1.12.4.min.js"></script>
	<script type="text/javascript" charset="UTF-8" src="/runtime/_systemjs/artdialog/artDialog.js?v=20200606"></script><script type="text/javascript" charset="UTF-8" src="/runtime/_systemjs/artdialog/plugins/iframeTools.js?v=2023"></script><link rel="stylesheet" type="text/css" href="/runtime/_systemjs/artdialog/skins/white.css" />
	<script type="text/javascript" charset="UTF-8" src="/runtime/_systemjs/form/form.js"></script>
	<script type="text/javascript" charset="UTF-8" src="/runtime/_systemjs/artTemplate/artTemplate.js"></script><script type="text/javascript" charset="UTF-8" src="/runtime/_systemjs/artTemplate/artTemplate-plugin.js"></script>
	<script type="text/javascript" charset="UTF-8" src="/runtime/_systemjs/autovalidate/validate.js?v=20200606"></script><link rel="stylesheet" type="text/css" href="/runtime/_systemjs/autovalidate/style.css" />
	<script type="text/javascript" charset="UTF-8" src="/runtime/_systemjs/cookie/jquery.cookie.js"></script>
	<script type='text/javascript' src="<?php echo $this->getWebViewPath()."javascript/html5.js";?>"></script>
	<!--[if lt IE 9]>
	<link rel="stylesheet" href="<?php echo $this->getWebSkinPath()."css/ie.css";?>" type="text/css" media="screen" />
	<![endif]-->
	<link rel="stylesheet" href="<?php echo $this->getWebSkinPath()."css/admin.css";?>" type="text/css" media="screen" />
	<script type='text/javascript' src="<?php echo IUrl::creatUrl("")."public/javascript/public.js";?>"></script>
	<?php $seller_id = $this->seller['seller_id'];$seller_name = $this->seller['seller_name'];?>
</head>

<body>
	<!--头部 开始-->
	<header id="header">
		<nav class="navbar">
			<div class="container-fluid">
				<div class="navbar-holder d-flex align-items-center justify-content-between">
					<div class="navbar-header">
						<h1 class="site_title">
						    <a href="<?php echo IUrl::creatUrl("/seller/index");?>"><?php echo $this->_siteConfig->name;?>商家管理</a>
						</h1>
					</div>

					<ul class="nav-menu list-unstyled d-flex flex-md-row align-items-md-center">
						<li class="nav-item"><a class="nav-link" href="<?php echo IUrl::creatUrl("");?>" target="_blank">网站首页</a></li>
						<li class="nav-item"><a class="nav-link" href="<?php echo IUrl::creatUrl("/site/home/id/".$seller_id."");?>" target="_blank">商家主页</a></li>
						<li class="nav-item"><a class="nav-link" href="<?php echo IUrl::creatUrl("/systemseller/logout");?>">退出登录</a></li>
					</ul>
				</div>
			</div>
		</nav>
	</header>
	<!--头部 结束-->

	<div class="page-content d-flex align-items-stretch">
		<!--侧边栏菜单 开始-->
		<nav id="sidebar" class="side-navbar">
			<ul class="list-unstyled">
				<?php foreach($items=menuSeller::init() as $key => $item){?>
				<li>
				    <a href="#<?php echo isset($key)?$key:"";?>" aria-expanded="false" data-toggle="collapse" name="menuItems" title="<?php echo isset($key)?$key:"";?>">
				        <i class=""></i> <?php echo isset($key)?$key:"";?>
				    </a>

					<ul id="<?php echo isset($key)?$key:"";?>" name="leftMenu" class="collapse list-unstyled" data-parent="#sidebar">
						<?php foreach($items=$item as $moreKey => $moreValue){?>
						<li><a href="<?php echo IUrl::creatUrl("".$moreKey."");?>"><?php echo isset($moreValue)?$moreValue:"";?></a></li>
						<?php }?>
					</ul>
				</li>
				<?php }?>
			</ul>
		</nav>
		<!--侧边栏菜单 结束-->

		<!--主体内容 开始-->
		<section class="content-inner">
			<script type="text/javascript" charset="UTF-8" src="/runtime/_systemjs/artTemplate/artTemplate.js"></script><script type="text/javascript" charset="UTF-8" src="/runtime/_systemjs/artTemplate/artTemplate-plugin.js"></script>
<script type="text/javascript" charset="UTF-8" src="/runtime/_systemjs/areaSelect/areaSelect.js"></script>
<article class="col-lg-12">
	<div class="card forms">
		<div class="card-header">
			<h3>添加从业人员</h3>
		</div>
		<div class="card-body">
			<form action='<?php echo IUrl::creatUrl("/auxiliary/employeeAdd");?>' class="form-horizontal" method='post' name='employeeAdd'
				enctype='multipart/form-data'>
				<input type='hidden' name='id' value="" />
				<div class="module_content">
					<div class="form-group row">
						<label class="col-sm-2 col-form-label">姓名</label>
						<div class="col-sm-10">
							<input name="name" class="form-control" value='' pattern='required' alt="填写姓名" />
						</div>
					</div>
					
					<div class="form-group row">
						<label class="col-sm-2 col-form-label">头像</label>
						<div class="col-sm-10">
							<input name="avatar" type="file" class="form-control-file" />
							<div class="box">
								<?php if(isset($this->employeeRow['avatar']) && $this->employeeRow['avatar']){?>
								<img src="<?php echo IUrl::creatUrl("".$this->employeeRow['avatar']."");?>" style='width:220px;border:1px solid #ccc' />
								<?php }?>
							</div>
							<small class="help-block-none">* 支持JPG/PNG格式，建议尺寸200x200</small>
						</div>
					</div>
					
					<div class="form-group row">
                        <label class="col-sm-2 col-form-label">运营商</label>
                        <div class="col-sm-10">
                            <select name='type' class="form-control" pattern="required" onchange="createTicket();">
                                <option value="0">店铺全部商品适用</option>
                                <option value="1">店铺某单品适用</option>
                                <option value="2">店铺某分类适用</option>
                            </select>
                            <small class="help-block-none">* 选择优惠券使用条件</small>
                        </div>
                    </div>
					
					<div class="form-group row">
						<label class="col-sm-2 col-form-label">简介</label>
						<div class="col-sm-10">
							<textarea name="introduction" class="form-control" rows="3" pattern='required' alt="填写从业人员简介"></textarea>
						</div>
					</div>
					
					<div class="form-group row">
						<label class="col-sm-2 col-form-label">从业人员编号</label>
						<div class="col-sm-10">
							<input class="form-control" name='employee_number' value='' pattern='required' alt="填写唯一从业人员编号" />
							<small class="help-block-none">* 编号需唯一，建议使用工号或身份证后6位</small>
						</div>
					</div>
					
					<div class="form-group row">
						<label class="col-sm-2 col-form-label">职务</label>
						<div class="col-sm-10">
							<input class="form-control" name='position' value='' pattern='required' alt="填写职务信息" />
						</div>
					</div>
					
					<div class="form-group row">
						<label class="col-sm-2 col-form-label">状态</label>
						<div class="col-sm-10">
							<select name="status" class="form-control">
								<option value="在岗" selected>在岗</option>
								<option value="离岗">离岗</option>
								<option value="返岗">返岗</option>
								<option value="离职">离职</option>
							</select>
							<small class="help-block-none">* 从业人员当前工作状态</small>
						</div>
					</div>
					
					<div class="form-group row">
						<div class="col-sm-4 offset-sm-2">
							<input type="submit" class="btn btn-primary" value="确 定" />
							<input type="reset" class="btn btn-secondary" value="重 置" />
						</div>
					</div>
				</div>
			</form>
		</div>
	</div>		
</article>

<script type='text/javascript'>
//DOM加载完毕
$(function(){
	//表单初始化
	var formObj = new Form('employeeAdd');
	formObj.init(<?php echo JSON::encode($this->employeeRow ?? []);?>);
});
</script>

		</section>
		<!--主题内容 结束-->
	</div>

	<script src="<?php echo IUrl::creatUrl("")."public/javascript/twitter-bootstrap/4.1.3/js/bootstrap.bundle.min.js";?>"></script>
	<script src="<?php echo IUrl::creatUrl("")."public/javascript/twitter-bootstrap/4.1.3/js/bootstrap.min.js";?>"></script>

	<script type="text/javascript">
	//菜单图片ICO配置
	function menuIco(val)
	{
		var icoConfig = {
			"统计结算模块" : "fa fa-bar-chart-o",
			"商品模块" : "fa fa-inbox",
			"订单模块" : "fa fa-file-text",
			"营销模块" : "fa fa-bullhorn",
			"配置模块" : "fa fa-gears"
		};
		return icoConfig[val] ? icoConfig[val] : "fa fa-list";
	}

	$("[name='menuItems']").each(function()
	{
		$(this).find("i").addClass(menuIco($(this).attr('title')));
	});

    //兼容IE系列
    $("[name='leftMenu'] [href^='javascript:']").each(function(i)
    {
    	var fun = $(this).attr('href').replace("javascript:","");
    	$(this).attr('href','javascript:void(0)');
    	$(this).on("click",function(){eval(fun)});
    });

    //重置容器高度
    function resizeContentHeight()
    {
        var winHeight     = $(window).height();
        var contentHeight = $('.page-content').outerHeight();
        var finnalHeight  = winHeight >= contentHeight ? winHeight : contentHeight;
        $('.page-content').css('height',finnalHeight);
        $('#sidebar').css('height',winHeight - 75);
    }

    //窗口大小调整触发
    window.onresize = resizeContentHeight;
    jQuery(function()
    {
        resizeContentHeight();
    });

    //获取左侧菜单项
    function matchLeftMenu(leftItem)
    {
        var matchObject = $('[name="leftMenu"]>li a[href="'+leftItem+'"]');
        if(matchObject.length > 0)
        {
            $.cookie('lastUrl', leftItem);
            return matchObject;
        }

        var lastUrl = $.cookie('lastUrl');
        if(lastUrl)
        {
            return $('[name="leftMenu"]>li a[href="'+lastUrl+'"]');
        }
        return null;
    }

    //左边栏菜单高亮
    var leftItem   = "<?php echo IUrl::getUri();?>";
    var matchObject = matchLeftMenu(leftItem);
    if(matchObject)
    {
        matchObject.parent().addClass('active').parent().collapse("show");
    }
	</script>
</body>
</html>